package org.leyi.shop.common.response;

import lombok.Data;

/**
 *
 * description:  TODO
 *<br> create 2024/5/4-23:35
 * @author  lenovo

 */
@Data

public class BaseResponse<T> {
    private int code;
    private T data;
    private String message;
    private String description;
    public BaseResponse(int code, T data, String message,String description) {
        this.code = code;
        this.data = data;
        this.message = message;
        this.description=description;
    }

    public BaseResponse(int code, String message,String description) {
        this.code = code;
        this.description=description;
        this.message = message;
        this.data=null;
    }
    public BaseResponse(EnumResponse EnumResponse,T data) {
        this.code = EnumResponse.getCode();
        this.description= EnumResponse.getDescription();
        this.message = EnumResponse.getMessage();
        this.data=data;
    }
    public BaseResponse(EnumResponse EnumResponse,T data,String message) {
        this.code = EnumResponse.getCode();
        this.description= EnumResponse.getDescription();
        this.message = message;
        this.data=data;
    }
    public BaseResponse(EnumResponse EnumResponse) {
        this(EnumResponse,null);
    }

}
